package com.gpslw.security.controller;

import com.gpslw.security.bean.Employee;
import com.gpslw.security.bean.UserInfo;
import org.springframework.security.core.authority.AuthorityUtils;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Collections;

@RestController
@RequestMapping(value = "/basic")
public class BasicController {

    @RequestMapping ("/getUserInfo")
    public UserInfo getUserInfo(Employee employee){
        return new UserInfo("abcd", "12345", AuthorityUtils.createAuthorityList("admin"));
    }

    @PostMapping("/test/{id}")
    public void test(Employee employee, @PathVariable("id") Long id){
        System.out.println("==========");
    }
}
